<template>
  <view>
    <view class="goods-item" >
      <view class="goods-item-pic">
        <image :src="goods.goods_small_logo || defaultPic" mode="aspectFill"></image>
      </view>
      <view class="goods-item-txt">
        <text>{{goods.goods_name}}</text>
        <text>￥{{goods.goods_price?.toFixed(2)}}</text>
      </view>
    </view>
  </view>
</template>

<script>
  export default {
    name:"my-goods",
    props: {
      goods: {
        type: Object,
        default: {}
      }
    },
    data() {
      return {
        // 默认图片
        defaultPic: 'https://img3.doubanio.com/f/movie/8dd0c794499fe925ae2ae89ee30cd225750457b4/pics/movie/celebrity-default-medium.png'
      };
    }
  }
</script>

<style lang="scss">
.goods-item{
    display: flex;
    padding: 10px;
    border: 1px solid #e2e2e2;
    
    .goods-item-pic {
      image {
        width: 100px;
        height: 100px;
      }
      width: 100px;
      height: 100px;
      margin-right: 5px;
    }
    .goods-item-txt {
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      font-size: 14px;
      text:nth-child(2) {
        font-size: 16px;
        color: #9b0000;
      }
    }
  }
</style>